<?php
// +----------------------------------------------------------------------
// | 萤火商城系统 [ 致力于通过产品和服务，帮助商家高效化开拓市场 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2023 https://www.yiovo.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed 这不是一个自由软件，不允许对程序代码以任何形式任何目的的再发行
// +----------------------------------------------------------------------
// | Author: 萤火科技 <admin@yiovo.com>
// +----------------------------------------------------------------------
declare (strict_types=1);

namespace app\api\service;

use app\api\model\IndexBanner as IndexBannerModel;
use app\api\model\IndexType as IndexTypeModel;
use app\common\service\BaseService;
use cores\exception\BaseException;

/**
 * 用户服务类
 * Class User
 * @package app\api\service
 */
class IndexBanner extends BaseService
{
    // 当前登录的会员信息
 
    public function getIndexBannerList(){
        $model = new IndexTypeModel;
        $BannerModel = new IndexBannerModel;
        $list = $model->getIndeTypeList();
        $total = array();
        foreach($list as $k=>$v)
        { 
            $total[$k]['first_name'] = $v['name'];
            $seList = $model->getIndeTypeList2((int)$v['type_id']);
            foreach($seList as $k1=>$v1){
                $total[$k]['first_list'][$k1]['second_name'] = $v1['name'];
                $bannerList = $BannerModel->getIndeBannerList($v['type_id'],$v1['type_id'],$v['store_id']);
                $total[$k]['first_list'][$k1]['second_list'] = $bannerList;
            }
        }

        return $total;

    }




}
